module addr_gen_lsm(
  input  [31:0] base,
  input  [ 4:0] offset,
  input         up,
  output [31:0] out
);

wire [31:0] offset_ext;

assign offset_ext = {25'b0,offset,2'b0};
assign out = up ? base + offset_ext : base - offset_ext;

endmodule
